package com.lilicould.dao;

import com.lilicould.entity.TeacherDetails;
import com.lilicould.entity.Teachers;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TeacherDao {
    // 获取所有老师详细信息
    @Select("select * from teacher_details_view")
    List<TeacherDetails> getTeacherDetails();

    // 获取指定老师详细信息
    @Select("select * from teacher_details_view where user_no=#{userNo}")
    TeacherDetails getTeacherDetailsByUserNo(String userNo);

    // 添加老师信息
    @Insert("INSERT INTO teachers VALUES (#{userNo},#{hireYear},#{collegeCode},#{title})")
    int addTeacher(Teachers teacher);

    // 删除老师信息
    @Delete("DELETE FROM teachers WHERE user_no=#{userNo}")
    int deleteTeacher(String userNo);
}
